package run;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * test controller
 *
 * @author yuyanan
 * @version 1.0
 * @date 19-05-15
 */
@RestController
public class UserController {

    /**
     * 查询服务器版本
     */
    @GetMapping("/o/ver")
    public Object ver(){
        return new Result(1,"不需要认证的接口","1.0");
    }

    @PostMapping("/user/birthday/get")
    public Object getUser(){
        return new Result(1,"此接口需要登录后访问","2018-05-06");
    }

    @PostMapping("/rest/test")
    public Object test(){
        return new Result(1,"rest","2018-05-06");
    }

    @PostMapping("/rest2/test")
    public Object test2(){
        return new Result(1,"mm","2018-05-06");
    }


    @AllArgsConstructor
    @NoArgsConstructor
    @Data
    static class Result {
        //返回码
        private int code;
        //描述
        private String msg;
        //数据信息
        private Object data;
    }


}
